import { weatherKey } from '@/constants/key'
import axios from 'axios'

//高德地图api
//获取当前ip位置
export function getLocation() {
  return axios.get('https://restapi.amap.com/v3/ip', {
    params: {
      key: weatherKey
    }
  })
}
//获取当前ip天气
export function getWeather(key: string, adcode: string) {
  return axios.get(`https://restapi.amap.com/v3/weather/weatherInfo`, {
    params: {
      key: key,
      city: adcode
    }
  })
}
